import axiosInstance from '../api/RequestHttp'
import { ResponseData } from '../model/ResponseData'

/**
 * 登录接口
 */
export const RequestLogin = (username: string, password: string): Promise<ResponseData> => {
    return axiosInstance({
        method: 'post',
        url: '/user/login',
        headers: { 'Content-Type': 'application/json' },
        data: {
            username,
            password
        }
    })
}

/**
 * 检查token
 */
export const RequestCheckToken = (): Promise<ResponseData> => {
    return axiosInstance({
        method: 'get',
        url: '/user/checkToken',
    })
}